<template>
  <basic-container>
    <div class="wrap" v-loading="loading" element-loading-text="数据加载中...">
      <dataList
        placeholder="请输入物业或工程名称查询"
        :pageInfo="pager"
        :listData="tableData"
        :selectData="selectDataArr"
        searchName="queryString"
        :menuList="['add','delete']"
        @menu-click="handleMenuClick"
      >
        <el-table :data="tableData" align="left" ref="multipleTable" @selection-change="$event => (selectDataArr = $event)">
          <el-table-column type="selection" width="55" />
          <el-table-column label="物业名称" width="170" prop="propertyName" show-overflow-tooltip />
          <el-table-column label="工程名称" prop="engineeringName" width="250" show-overflow-tooltip />
          <el-table-column label="施工单位" width="150" prop="unitName" show-overflow-tooltip />
          <el-table-column label="单位类型" width="120" prop="unitType">
            <template slot-scope="scope">{{getCompanyName(scope.row.unitType)}}</template>
          </el-table-column>
          <el-table-column label="验收日期" :formatter="dateFormatter" width="150" prop="deliverableTm" />
          <el-table-column label="验收评语" prop="performanceEvaluation" show-overflow-tooltip width="120" />
          <el-table-column label="验收状态" width="160" prop="isQualified">
            <template slot-scope="scope">{{scope.row.isQualified | dict('is_qualified')}}</template>
          </el-table-column>
          <el-table-column label="操作" fixed="right" width="150" class="operaColumn">
            <template slot-scope="scope">
              <el-button type="text" size="mini" @click="handleBtnClick('preview',scope.row)">查看</el-button>
              <el-button type="text" size="mini" @click="handleBtnClick('edit',scope.row)">编辑</el-button>
              <el-button type="text" size="mini" @click="handleBtnClick('delete',scope.row)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </dataList>
    </div>
    <!-- 新增|编辑|查看 单位 -->
    <departmentDialog ref="editDialog" />
    <!-- 上传组件功能细节待确定 -->
  </basic-container>
</template>

<script src='./index.js'></script>

<style lang="scss" scoped>
@import "src/views/wy-operate/css/operate.scss";
.operateMain {
  /deep/ .top-buttons {
    float: right;
    width: 50%;
  }
  /deep/ .v-search {
    width: 50%;
    justify-content: flex-start;
  }
  /deep/ .operaColumn .el-button {
    color: var(--color);
  }
}
</style>
